package com.sandu.lib_common.webview

import android.content.Context
import android.os.Handler
import android.os.Looper
import android.webkit.JavascriptInterface
import com.alibaba.android.arouter.launcher.ARouter
import com.just.agentweb.AgentWeb
import com.sandu.lib_common.arouter.ARouterPath
/**
 * 作者　: sandu
 * 时间　: 2024/11/21
 * 描述　: 安卓与js交互接口类
 */
open class AndroidInterface(agentWeb: AgentWeb, context: Context) {
    var deliver = Handler(Looper.getMainLooper())
    var agent: AgentWeb = agentWeb
    var context: Context = context


    @JavascriptInterface
    fun backToMine() {
        ARouter.getInstance().build(ARouterPath.MINE_ACTIVITY).navigation();
    }

    @JavascriptInterface
    fun backToMain() {
        ARouter.getInstance().build(ARouterPath.MINE_ACTIVITY).navigation();
    }

}